/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.can.beans;

import edu.upn.sigemfi.can.bc.TransaccionWebDelegate;
import edu.upn.sigemfi.can.be.TransaccionWeb;
import java.util.List;

/**
 *
 * @author Orlando ( U )
 */
public class TransaccionWebController {

    private TransaccionWebDelegate delegado;
    private TransaccionWeb transaccionWeb;

    public TransaccionWebController(){
        delegado = new TransaccionWebDelegate();
    }

    public List<TransaccionWeb> getTransaccionesWebs() {
        try {
            return delegado.listar();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public String nuevo() {
        transaccionWeb = new TransaccionWeb();
        return "nuevo";
    }

    public String editar() {
        return "editartransaccionweb";
    }

    public String registrar() {
        try {
            delegado.crear(transaccionWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String eliminar(){
        try {
            delegado.eliminar(transaccionWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String actualizar() {
        try {
            delegado.editar(transaccionWeb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public TransaccionWeb getTransaccionWeb() {
        return transaccionWeb;
    }

    public void setTransaccionWeb(TransaccionWeb transaccionWeb) {
        this.transaccionWeb = transaccionWeb;
    }
    
}
